package com.dragon.app.ykd.constant;

/**
 * 展期类型
 * 
 * @title ExtensionType
 * @author tuxu
 * @date 2018年10月29日
 */
public enum ExtensionType {
	/**
	 * 一天展期
	 */
	ONEDAY("1", 1, "100", "1天展期"),
	/**
	 * 三天展期
	 */
	THREEDAY("2", 3, "200", "3天展期"),
	/**
	 * 七天展期
	 */
	SEVENDAY("3", 7, "300", "7天展期");

	private String code;
	// 展期天数
	private int days;
	// 展期金额
	private String money;
	private String msg;

	private ExtensionType(String code, int days, String money, String msg) {
		this.code = code;
		this.days = days;
		this.money = money;
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getDays() {
		return days;
	}

	public void setDays(int days) {
		this.days = days;
	}

	public String getMoney() {
		return money;
	}

	public void setMoney(String money) {
		this.money = money;
	}
	
	public static ExtensionType getExtensionType(String code) {
		for (ExtensionType extensionType : ExtensionType.values()) {
			if (extensionType.getCode().equals(code)) {
				return extensionType;
			}
		}
		return null;
	}

	/**
	 * 判断是否包含code
	 * 
	 * @param code
	 * @return
	 */
	public static boolean containsCode(String code) {
		if (getExtensionType(code) != null) {
			return true;
		}
		return false;
	}

	public static boolean notContainsCode(String code) {
		return !containsCode(code);
	}
}
